package top.wugy.blog.kits;

import com.jfinal.kit.PropKit;

/**
 * wugy on 2017/11/2 16:10
 */
public interface Const {

    // 数据库配置
    String DB_URL = PropKit.get("DB_URL");
    String DB_USERNAME = PropKit.get("DB_USERNAME");
    String DB_PWD = PropKit.get("DB_PASSWORD");

    // 响应标识
    String RES_CODE = "code";
    String RES_MSG = "msg";
    String RES_DATA = "data";
    int SUCCESS = 0;
    int ERROR = -1;

    String QINIU_ACCESSKEY = PropKit.get("QINIU_ACCESSKEY");
    String QINIU_SECRETKEY = PropKit.get("QINIU_SECRETKEY");
    String QINIU_DOMAIN = PropKit.get("QINIU_DOMAIN");
    String QINIU_BUCKET = PropKit.get("QINIU_BUCKET");
    String JWT_SECRET = PropKit.get("JWT_SECRET");
    //     token有效时长，单位秒, 1h=3600s
    int JWT_EXPIRE = PropKit.getInt("JWT_EXPIRE", 3600);
    boolean DEV_MODE = PropKit.getBoolean("devMode", true);
    int DEF_PAGE_SIZE = PropKit.getInt("limit", 10);

    String REDIS_CACHE = "blue-blog";
    String REDIS_HOST = PropKit.get("REDIS_HOST");
    int PORT = PropKit.getInt("port", 80);


    String TOKEN = "token";

    String DEF_DATE_FORMAT = "yyyy-MM-dd HH:mm";
    String DATE_FORMAT = "yyyy-MM-dd";

    // 状态
    int NORMAL = 1;
    int DEL = 0;

    // 数据库主键column，统一为id
    String PK_FIELD = "id";
    // 数据库表名
    String TABLE_BLOG = "t_blog";
    String TABLE_USER = "t_user";
    String TABLE_LINK = "t_link";
    String TABLE_TAG = "t_tag";
    String TABLE_TIMELINE = "t_timeline";

    String LOGIN_TIME = "loginTime";
}
